﻿<html>
<head>
<title>加密文本</title>
<link rel="stylesheet" href="/css/def.css">
<script src="/js/p.js"></script>
</head>

<body class="MyBody" scroll="yes">

<div style="overflow: auto; text-align: left; height: 35px; background-color: #C1FFE4;"></div>

<table cellpadding='0' cellspacing='0' class='Header3'>
<tr>
<td nowrap="nowrap" align="left" style="background-color:#fcfcfc;">
<div>&nbsp;明文：<input type="password" name="plainText" id="plainText" size="60" /></div>
<div>&nbsp;密文：<textarea name="cipherText" id="cipherText" cols="60" rows="10" /></textarea></div>
<div>
<input type="button" name="cipherData" value="加密" onclick="cipherData()" />
</div>
</td>
</tr>
</table>
<div id="divResultMsg" style="text-align: left; background-color: #C1FFE4;">
<table id="tabResultMsg" style="border: solid 0px #C1FFE4; text-align:left;color: #3E6373; display:none;">
<tr>
<td style="padding: 5px 0px 0px 10px;vertical-align: top;"></td>
<td style="padding-top:5px"><pre id="spanResultMsg" style=" font-size: 12px;"></pre></td>
</tr></table>
</div>

<div id="divHintMsg" style="position:absolute; top:0px; right:30px; z-index: 9901;background:#DDDDDD;filter:alpha(opacity=90);opacity:0.9; border: solid 1px #BCBCBC; display: none;"></div>

<script type="text/javascript">
function cipherData(){
	outputResultMsg("");
	var pData = "{\"plainText\":\""+encodeURI(document.getElementById("plainText").value)+"\"}";
	postHttp("/c/cipherdata", pData, showCipherText);
}

function showCipherText () {
	try {
		var jsonTxt = eval('('+this.responseText+')');
		var respCode = jsonTxt["respCode"];
		var respInfo = jsonTxt["respInfo"];
		if("0" == respCode.toString()){
			document.getElementById("cipherText").value = jsonTxt["result"];
		}else{
			outputResultMsg(respInfo);
		}
	}
    catch (err) {
    	var msg = "此页面存在一个错误。\r\n错误描述: " + err.description;
    	if (this.responseText !== undefined && this.responseText !== null && this.responseText !== ""){
    		msg+="\r\n响应内容："+this.responseText;
    	}
        outputResultMsg(msg);
    }
}
</script>
</body>
</html>
